#include <iostream>
using namespace std;
class A
{
private:
	static int k;
	int h = 10;
public:
	class B // B天生就是A的友元
	{
	public:
		void foo(const A& a)
		{
			cout << k << endl; //访问外部类静态成员OK
			cout << a.h << endl; //访问外部类非静态成员OK
		}
	};
};

int A::k = 1;

int main()
{
    cout << sizeof(A) << endl; //
	A::B b;
	b.foo(A());
	return 0;
}
